<?php

namespace App\Http\Controllers\Api\O1\UserCenter\Paper;

use Illuminate\Http\Request;
use Biz\Services\Site\SitePaperService;
use Biz\Requests\Site\StorePaperAbstractRequest;
use Biz\Requests\Site\UpdatePaperAbstractRequest;
use Biz\Resources\Site\SitePaperAbstractResource;
use Lumen\Http\Resources\Json\DataResourceResponse;
use Biz\Transformers\Site\PaperTransformerCollection;
use Laravel\Lumen\Routing\Controller as BaseController;
use Biz\Resources\Site\SitePaperAbstractResourceCollection;

/**
 * PaperAbstractController.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class AbstractController extends BaseController
{
    /**
     * @var mixed
     */
    protected $service;

    /**
     * PaperAbstractController constructor.
     *
     * @param SitePaperService $service
     */
    public function __construct(SitePaperService $service)
    {
        $this->service = $service;
    }

    /**
     * Display a listing of the resource.
     *
     * @param Request $request
     *
     * @return SitePaperAbstractResourceCollection
     */
    public function index(Request $request)
    {
        $results = $this->service->getUserPaperAbstractList($request);

        return new PaperTransformerCollection($results);
    }

//    /**
//     * Store a newly created resource in storage.
//     *
//     * @param StorePaperAbstractRequest $request
//     * @param string                    $paper_id
//     *
//     * @return \Illuminate\Http\Response
//     */
//    public function store(StorePaperAbstractRequest $request, string $paper_id)
//    {
//        $abstract = $this->service->store($request, $paper_id);
//
//        return new SitePaperAbstractResource($abstract);
//    }
//
//    /**
//     * Display the specified resource.
//     *
//     * @param string $paper_id
//     * @param string $abstract_id
//     *
//     * @return \Illuminate\Http\Response
//     */
//    public function show(string $paper_id, string $abstract_id)
//    {
//        $abstract = $this->service->show($paper_id, $abstract_id);
//
//        return new SitePaperAbstractResource($abstract);
//    }
//
//    /**
//     * Update the specified resource in storage.
//     *
//     * @param UpdatePaperAbstractRequest $request
//     * @param string                     $paper_id
//     * @param string                     $abstract_id
//     *
//     * @return \Illuminate\Http\Response
//     */
//    public function update(UpdatePaperAbstractRequest $request, string $paper_id, string $abstract_id)
//    {
//        $abstract = $this->service->edit($paper_id, $abstract_id, $request->all());
//
//        return new SitePaperAbstractResource($abstract);
//    }
//
//    /**
//     * Remove the specified resource from storage.
//     *
//     * @param string $paper_id
//     * @param string $abstract_id
//     *
//     * @return \Illuminate\Http\Response
//     */
//    public function destroy(string $paper_id, string $abstract_id)
//    {
//        $result = $this->service->remove($paper_id, $abstract_id);
//
//        return new DataResourceResponse($result);
//    }
}
